function* gen(){
    const result = yield new Promise((resolve)=>{
        setTimeout(()=>{
            resolve("wokao");
        },2000)
    });
}

const g = gen();
const result = g.next();
result.value.then(function(data){
    console.log(data);
    return data;
}).then(function(data){
    g.next(data);
});

// Promise{<pending>}
// wokao


new Promise((resolve)=>{
    setTimeout(()=>{
        resolve("wokao");
    },2000)
})
.then(d=>console.log(d))
.then(d=>console.log(d))

